Ext.onReady(
function() {
	var button=Ext.get('show-button');
	var win;
	var mystore=new Ext.data.Store({
//				url:'http://192.168.0.199:8080/report/view?id=0&rule=2',
				proxy: new Ext.data.HttpProxy({
					url:'./view?id=0&rule=2',
					method:"GET"
				}),
//				autoLoad:true,
				reader: new Ext.data.XmlReader({
					record:'row',
					
				},
				['name']
				)
			});
	mystore.load();
	var combo=new Ext.form.ComboBox({
	        forceSelection: true,
    	    triggerAction: 'all',
        	selectOnFocus:true,
        	lazyInit: false,
			displayField:'name',
			store: mystore,
			fieldLabel:'Менеджер',
			editable:false,
			emptyText:'Найди себя!'
		
	});
    var form = new Ext.form.FormPanel({
        baseCls: 'x-plain',
        layout:'form',
		id:'form1',
        items:[
		combo,
		{
			id:'pass',
			xtype:'textfield',
			inputType: 'password',
			fieldLabel:'Пароль',
		}		
		],
    });
	button.on('click',function(){
	if (!win) {
		win = new Ext.Window({

                layout:'fit',
                width:300,
                height:150,
                closeAction:'hide',
                plain: true,
 	       items:  form,
		buttons:[
		{
			text: 'Ok!',
			handler:function(){
				var mainWin=Ext.getDoc();
//				mainWin.Source='./index.html';
				document.location.href='./index.html';
			}
		},
		{
			text: 'Отмена',
			handler:function(){
				win.hide();
			}
		},
		{
			text:'Сменить пароль'
		}]
		   
		});
	};
	win.show(this);
	});
});
